#include <QWebView>
#include <QString>
#include <QIcon>

#include "uifactory.h"


void UiFactory::displayMessage(QWebView *view, const QString &title, const QString &desc) {
    view->setHtml(UiFactory::getHeader(title) + desc);
}

QString UiFactory::getHeader(const QString &text) {
    QString string;
    string.push_back("<div style=\"-webkit-border-radius: 15px; text-align: center; border: solid 2px #EEEEEE;background-color: #f9f9f9;padding: 10px;margin: 4px 4px 0px 4px; float:both;\">");
    string.push_back(text);
    string.push_back("</div><br>");
    return string;
}

void UiFactory::setupStateIcons(const QString &neww, const QString &normal, const QString &error) {
	stateNewIcon = QIcon(neww);
	stateNormalIcon = QIcon(normal);
	stateErrorIcon = QIcon(error);
}
